import React from 'react'
import { Route } from 'react-router'
import App from '../containers/App'
import Empty from '../containers/Empty'
import Empty2 from '../containers/Empty2'

import Home from '../page/home/Home'
/*
const routes = [{
	{
		path: '*',
		getComponents(location, callback) {
	    require.ensure([], function (require) {
	      callback(null, require('../page/NoMatch'))
	    })
		}
	},
]
*/
const routes = [{
		path: '/',
    component: App,
    indexRoute: { component: Home },
    childRoutes: [
    	{
      	path: 'system',
      	component: Empty,
      	childRoutes: [
      		{
      			path: 'areaMechanism',
      			component: Empty,
		      	childRoutes: [
		      		{
			      	  path: 'area',
				      	component: require('../page/system/area')
				      },
				      {
				      	path: 'organization',
				      	component: require('../page/system/organization')
					    }
		      	]
      		},
      		{
		      	path: 'dictionaryManage',
		      	component: Empty,
		      	childRoutes: [{
			      	path: 'dictionary',
			      	component: require('../page/system/dictionary')
			      }]
		      },
		      {
		      	path: 'permission',
		      	component: Empty,
		      	childRoutes: [
		      		{
				      	path: 'list',
				      	component: require('../page/system/list')
				      },
				      {
				      	path: 'role',
				      	component: require('../page/system/role')
				      },
				      {
				      	path: 'users',
				      	component: require('../page/system/users')
				      },
				      {
				      	path: 'townsUsers',
				      	component: require('../page/system/townsUser')
				      },
				      {
				      	path: 'password',
				      	component: require('../page/system/password')
				      }
		      	]
		      },
          {
            path: 'news',
            component: Empty,
            childRoutes: [
              {
                path: 'list',
                component: require('../page/news/list')
              },
              {
                path: 'show/:id',
                component: require('../page/news/show')
              },
            ]
          },
          {
            path: 'feedback',
            component: Empty,
            childRoutes: [
              {
                path: 'list',
                component: require('../page/feedback/list')
              }
            ]
          }
      	]
      },
      {
      	path: 'projectRegister',
      	component: Empty,
      	childRoutes:[
      		{
      			path: 'townsRegistingList',
				    component: require('../page/projectRegister/townsRegistingList')
      		},
      		{
      			path: 'townsRegistedList',
				    component: require('../page/projectRegister/townsRegistedList')
      		},
      		{
      			path: 'finishBatchList',
				    component: require('../page/projectRegister/finishBatchList')
      		},
      		{
      			path: 'townsAuditoringList',
				    component: require('../page/projectRegister/townsAuditoringList')
      		},
      		{
      			path: 'townsAuditoredList',
				    component: require('../page/projectRegister/townsAuditoredList')
      		},
      		{
      			path: 'orgAuditorList',
				    component: require('../page/projectRegister/orgAuditorList')
      		},
      		{
      			path: 'orgBatchSummaryList',
				    component: require('../page/projectRegister/orgBatchSummaryList')
      		},
      		{
      			path: 'financeAuditorList',
				    component: require('../page/projectRegister/financeAuditorList')
      		},
      		{
      			path: 'financeAuditoredSummaryBatchList',
				    component: require('../page/projectRegister/financeAuditoredSummaryBatchList')
      		},
          {
            path: 'registerList',
            component: require('../page/projectRegister/registerList')
          },
          {
            path: 'listCitizen',
            component: require('../page/projectRegister/listCitizen')
          }
      	]
      },
      {
      	path: 'data',
      	component: Empty,
      	childRoutes:[
      		{
      			path: 'project',
		      	component: Empty,
		      	childRoutes: [
			      	{
				      	path: 'category',
				      	component: require('../page/data/projectCategory')
				      },
				      {
				      	path: 'list',
				      	component: require('../page/data/projectList')
				      },
				      {
				      	path: 'tag',
				      	component: require('../page/data/projectTag')
				      },
				      {
				      	path: 'dic',
				      	component: require('../page/data/projectDic')
				      }
			      ]
			    }
			  ]
      },
      {
      	path: 'citizen',
      	component: Empty,
      	childRoutes: [
      		{
		      	path: 'list',
		      	component: require('../page/data/citizenList')
		      },
		      {
      			path: 'uploadBank',
		      	component: require('../page/data/uploadBank'),
      		},
          {
            path: 'uploadName',
            component: require('../page/data/uploadName'),
          },
          {
            path: 'uploadArea',
            component: require('../page/data/uploadArea'),
          },
          {
            path: 'downloadCitizen',
            component: require('../page/data/downloadCitizen'),
          }
      	]
      },
      {
      	path: 'supervise',
      	component: Empty,
      	childRoutes: [
      		{
      			path: 'nomatch',
		      	component: Empty2,
      		}
      	]
      },
      {
      	path: 'visualization',
      	component: Empty,
      	childRoutes: [
      		{
      			path: 'register',
		      	component: require('../page/visualization/register'),
      		},
          {
            path: 'citizen',
            component: require('../page/visualization/citizen'),
          }
      	]
      },
      {
      	path: 'bigdata',
      	component: Empty,
      	childRoutes: [
      		{
      			path: 'nomatch',
		      	component: Empty2,
      		}
      	]
      }
    ]
	},
	{
		path: '*',
		component: require('../page/NoMatch')
	},
]
export default routes;